#ifndef _SnatchFragmentIcon_h__
#define _SnatchFragmentIcon_h__

#include "Global.h"
#include "item/Item.h"

class SnatchFragmentIcon
	: public CCNode
	, public CCBMemberVariableAssigner
	, public CCBSelectorResolver
	, public CCNodeLoaderListener
	, public ViewBase
{
public:
	CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(SnatchFragmentIcon, create);
	static SnatchFragmentIcon* create(CCObject* pOwer);

	SnatchFragmentIcon(void);
	~SnatchFragmentIcon(void);

	virtual bool onAssignCCBMemberVariable(CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode);
	virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, CCString * pSelectorName);
	virtual void onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader);

	bool init();
	void refresh();
	void onEnter();
	void onExit();
private:
	Item* mItemIcon;
	CCSprite* mMask;
	CCSprite* mCountBg;
	CCLabelTTF* mCount;
	void _onNotification(CCObject* object);
	void onDoItClick(CCObject* pSender);
	void onMergeBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	void onCloseBtnClick(CCObject * pSender, CCControlEvent pCCControlEvent);
	
};

#endif